<?php
$n = new swoole_atomic(1);
$n->add(10);
$n->sub(2);
$n->set(20);
$n->cmpset(30,90);
var_dump($n->get());



$n = new swoole_atomic(0);
if(pcntl_fork()>0){
   echo "master start==".PHP_EOL;
   $n->wait(10);
   echo "master end==".PHP_EOL;
}else{
    echo "child start==".PHP_EOL;
    $n->wakeup();//wakeup 会唤醒上面wait()等待进程
    echo "child end==".PHP_EOL;
}


